package com.lc202310;


import java.util.ArrayList;
import java.util.List;

/**
 * Description:
 *
 * @Create 2023/10/21 23:20
 * @Version 1.0
 */
public class Solution94 {
    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> res = new ArrayList<>();
        inorderTree(root, res);
        return res;
    }

    private void inorderTree(TreeNode node, List<Integer> res) {
        if (node == null) {
            return;
        }
        inorderTree(node.left, res);
        res.add(node.val);
        inorderTree(node.right, res);
    }
}
